﻿using System;
using System.Configuration;
using FX.CC.Andon.Business.SystemManage;
using FX.CC.Andon.Entity.SystemManage;
using FX.CC.Andon.Utility.Common;

namespace FX.CC.Andon.WebSite.UI
{
    public class BasicPage : System.Web.UI.Page
    {
        protected internal WebSet Webset;

        public BasicPage()
        {
            Load += PageLoad;
            this.Webset = new WebSetBusiness().loadConfig(Server.MapPath(ConfigurationManager.AppSettings["WebSetpath"]));
        }

        private void PageLoad(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(SysContext.CurrentLoginCode) &&
                !string.IsNullOrEmpty(SysContext.CurrentFullName) &&
                !string.IsNullOrEmpty(SysContext.CurrentRoleId)) return;
            Response.Write("<script>parent.location.href='/login.aspx'</script>");
            Response.End();
        }
    }
}
